{%extends 'account/base.html' %}
{% load staticfiles %}
{% load oauth_tags %}

{% block title %}
<title>个人中心</title>
{% endblock %}


<!--主要内容块-->
{% block main %}
<main>
<div class="container">
    <div class="row">
        <div class="col-12 col-sm-8 col-md-6 offset-sm-2 offset-md-3 px-xl-5">
            <div class="card rounded-0 px-3 px-lg-4">
                <div class="card-header text-center bg-white py-2"><h3 class="my-1 text-info">个人资料</h3></div>
                <div class="card-body">
                    <ul class="list-group">
                        <li class="list-group-item text-center border-0" id="profile-avatar">
{% get_user_data request.session.uid as user %}
                            {% if user %}

                            <img class="avatar" src="/media/{{ user.avatar }}" alt="{{user.username}}">

                        </li>
                        <li class="list-group-item ml-5 border-0">
                            <span class="font-weight-bold">用户名：</span>
                            <span>{{ user.username }}</span>
                        </li>
                        <li class="list-group-item ml-5 border-0">
                            <span class="font-weight-bold">邮&emsp;箱：</span>
                            <span>{{ user.email }}</span>
                        </li>
                        <li class="list-group-item ml-5 border-0">
                            <span class="font-weight-bold">网&emsp;址：</span>
                            <span>{{ user.link }}</span>
                        </li>
                    </ul>
                </div>
                <div class="text-center mb-5" id="social-login">
                    <div class="more-link mt-3">
                        <a class="btn btn-info btn-sm rounded-0 mx-3" href="/accounts/profile/change/">修改资料</a>
                        <a class="btn btn-info btn-sm rounded-0 mx-3" href="/">返回首页</a>
                    </div>
                </div>
                {% endif %}
            </div>
        </div>
    </div>
</div>
</main>
{% endblock main %}
